﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using publicLibrary;

namespace asMeishi.web.Controllers
{
    using Models;

    [authorityFilter(actionEnum.manage, actionTypeEnum.str)]
    public class manageController : Controller
    {
        //
        // GET: /manage/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult 提取address字段中的街道部分存入street中() { 
            shopC sc = new shopC();

            foreach(var s  in sc.getAll()){
                if(!String.IsNullOrWhiteSpace(s.addressStr)){
                    s.street = s.addressStr.Replace("铁东区","").Replace("铁东","").Replace("铁西区","").Replace(" ","").Replace("立山区","").Replace("立山","");
                }
                sc.save(s);
            }

            
            return Content("ok");
        }
        public ActionResult 整合area和street两段字段并存入address中(){
             shopC sc = new shopC();
             foreach(var s  in sc.getAll()){
                 s.addressStr = s.area + s.street;
                sc.save(s);
            }
            return Content("ok");
        }
    }
}
